package view;

import java.util.ArrayList;

import model.User;
import Repository.Repository;
import Repository.RepositoryFactory;
import constants.SMSConstants;

public class RepView extends View{
	
	public RepView(User user){
		super(user);
	}
	
	public void retrieveView(){
		Repository repository = RepositoryFactory.getRepository(SMSConstants.LEAD);
		leadObjects.clear();;
		leadObjects.addAll(getSMSObjectForUser(repository.retrieve("Assigned")));
		leadObjects.addAll(getSMSObjectForUser(repository.retrieve("Merged")));
		leadObjects.addAll(getSMSObjectForUser(repository.retrieve("Qualified")));
		
		oppObjects.clear();;
		repository = RepositoryFactory.getRepository(SMSConstants.OPPORTUNITY);
		oppObjects.addAll(getSMSObjectForUser(repository.retrieve("Imported")));
		oppObjects.addAll(getSMSObjectForUser(repository.retrieve("Prepared")));
		oppObjects.addAll(getSMSObjectForUser(repository.retrieve("Approved")));
		
		
		
		 contractObjects.clear();;
		repository = RepositoryFactory.getRepository(SMSConstants.CONTRACT);
		contractObjects.addAll(getSMSObjectForUser(repository.retrieve("Imported")));
		
				
	}

}
